/****************************************************
 *
 * 项目名称：  com.heroh.util.convert
 * All rights Reserved, Designed By 投资交易团队
 * @Copyright:2016-2021
 *
 ********************************************************/

package com.heroh.util.convert;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * 包名称： com.heroh.util.convert
 * 类名称：Java2TSUtil
 * 类描述：TODO
 * 创建人：@author shengxiong.jian
 * 创建时间：2021/3/8/10:17
 */
public class Java2TSUtil implements TypeConvertUtil {

    private static final List<String> numberTypes = Arrays.asList("Byte", "Double", "Float", "Integer", "Long", "Short", "BigDecimal");

    private static final String dateType = "Date";

    @Override
    public String covert(String javaType) {
        if (numberTypes.contains(javaType)) {
            return "number";
        }

        if(dateType.equals(javaType)) {
            return dateType;
        }

        return javaType.trim().toLowerCase();
    }
}
